package com.jilian.mydemo.modul.main.ui;

import android.widget.TextView;

import com.jilian.mydemo.R;
import com.jilian.mydemo.base.BaseActivity;
import com.jilian.mydemo.utils.RxTimerUtil;

public class TestActivity extends BaseActivity {
    private TextView one;
    private TextView two;
    private TextView three;
    private TextView four;



    @Override
    protected void createViewModel() {

    }

    @Override
    public int intiLayout() {
        return R.layout.activity_test;
    }

    @Override
    public void initView() {
        one = (TextView) findViewById(R.id.one);
        two = (TextView) findViewById(R.id.two);
        three = (TextView) findViewById(R.id.three);
        four = (TextView) findViewById(R.id.four);
    }
    private int oneText = 0;
    private int twoText = 0;
    private int threeText = 0;
    private int fourText = 0;
    @Override
    public void initData() {
        RxTimerUtil.interval(1000, new RxTimerUtil.IRxNext() {
            @Override
            public void doNext() {
                oneText++;
                one.setText(oneText+"");
            }
        });

        RxTimerUtil.interval(1000, new RxTimerUtil.IRxNext() {
            @Override
            public void doNext() {
                twoText++;
                two.setText(twoText+"");
            }
        });
        RxTimerUtil.interval(1000, new RxTimerUtil.IRxNext() {
            @Override
            public void doNext() {
                threeText++;
                three.setText(threeText+"");
            }
        });
        RxTimerUtil.interval(1000, new RxTimerUtil.IRxNext() {
            @Override
            public void doNext() {
                fourText++;
                four.setText(fourText+"");
            }
        });
    }

    @Override
    public void initListener() {

    }
}
